import request from '@/utils/request'

const prefixUrl = 'web/login/'

export function ssoLogin(data) {
  return request({
    url: prefixUrl + 'sso-login',
    method: 'post',
    data
  })
}

export function login(data) {
  return request({
    url: prefixUrl + 'sign-in',
    method: 'post',
    data
  })
}

export function loginByMobile(data) {
  return request({
    url: prefixUrl + 'sign-in-mobile',
    method: 'post',
    data
  })
}

export function getInfo(token) {
  return request({
    url: prefixUrl + 'info',
    method: 'get',
    params: {token}
  })
}

export function logout() {
  return request({
    url: prefixUrl + 'sign-out',
    method: 'put'
  })
}

export function resetPassword(data) {
  return request({
    url: prefixUrl + 'reset_password',
    method: 'put',
    data: data,
		content_type: 'json'
  })
}

// 招商经理列表 不带分页
export function getManagerList() {
  return request({
    url: prefixUrl + '/list',
    method: 'get'
  })
}
// 所有用户 可区分是否渠道
export function getAllUserList() {
  return request({
    url: prefixUrl + '/allUserList',
    method: 'get'
  })
}

export function chooseOrg(params) {
  return request({
    url: prefixUrl + 'choose_org',
    method: 'get',
    params
  })
}
